/*
 ------------------------------------------------------------------------------
 Copyright (C) 2006-2007 Team Blur.

 This file is part of the Quantum Engine source code.

 The Quantum Engine source code is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or (at your
 option) any later version.

 The Quantum Engine source code is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 more details.

 You should have received a copy of the GNU General Public License along with
 the Quantum Engine source code; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 ------------------------------------------------------------------------------
*/


#ifndef __SG_CLIP_H__
#define __SG_CLIP_H__


#define MAX_SECTORS					64
#define MAX_SECTOR_DEPTH			4

typedef struct clipSector_s {
	int						axis;				// -1 == leaf node
	float					dist;

	struct clipSector_s *	children[2];
	struct entity_s *		entities;
} clipSector_t;

void			SG_InitClipSectors (void);
void			SG_ShutdownClipSectors (void);

void			SG_LinkEntity (entity_t *entity);
void			SG_UnlinkEntity (entity_t *entity);

int				SG_Contents (const odVec3 &point, const odBounds &bounds, int contentMask, int passEntityNum);
trace_t			SG_Trace (const odVec3 &start, const odVec3 &end, const odBounds &bounds, int contentMask, int passEntityNum);


#endif	// __SG_CLIP_H__
